using System;
using System.Collections.Generic;
using System.Text;

namespace igather.Framework
{
    /// <summary>
    /// The vertex of a graph
    /// Contains information about a tag
    /// </summary>
    /// <remarks>
    /// This class MUST remain immutable
    /// </remarks>
    public class Vertex
    {
        private string mName;

        /// <summary>
        /// Gets the name of this vertex
        /// </summary>
        public string Name
        {
            get { return mName; }
        }
		
		public string Url
		{
			get;
			set;
		}
		
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="name">Name of this vertex</param>
        public Vertex(string name)
        {
            mName = name;
        }

        /// <summary>
        /// Overrides default comparison
        /// </summary>
        /// <param name="obj">Object to compare with</param>
        /// <returns>True if objects are equal, otherwise false</returns>
        public override bool Equals(object obj)
        {
            bool equals = false;
            Vertex v = obj as Vertex;
            if (v != null)
                equals = (mName.Equals(v.mName));

            return equals;
        }

        /// <summary>
        /// Overrides default hash
        /// </summary>
        /// <returns>Hash code for this object</returns>
        public override int GetHashCode()
        {
            return mName.GetHashCode();
        }
    }
}
